package org.raymond.icloud.modules.admin.controller;

import cn.hutool.crypto.asymmetric.RSA;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.raymond.icloud.apis.admin.service.ICommonServiceApi;
import org.raymond.icloud.apis.admin.vo.FakeCaptchaVO;
import org.raymond.icloud.common.core.model.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

//@Api(tags = "通用接口组")
@Slf4j
@RestController
public class CommonController implements ICommonServiceApi {
    @Autowired
    private RSA rsa;

    @Override
    public Result<String> publicKey() {
        return Result.success(rsa.getPublicKeyBase64());
    }

    @Override
    public Result<FakeCaptchaVO> captcha(String mobile) {
        FakeCaptchaVO vo = new FakeCaptchaVO();
        vo.setCaptcha("1234");
        return Result.success(vo);
    }
}
